package org.apache.ocean;

/**
 *
 * @author jasonr
 */
public class CLong implements Comparable<CLong>, Cloneable {
  public static CLong MAX_VALUE = new CLong(Long.MAX_VALUE);
  public long value;
  
  public CLong(long value) {
    this.value = value;
  }
  
  public CLong(String string) {
    value = Long.parseLong(string);
  }
  
  public CLong clone() {
  	return new CLong(value);
  }
  
  public String toString() {
    return Long.toString(value);
  }
  
  public int hashCode() {
    return (int)(value ^ (value >>> 32));
  }
  
  public boolean equals(Object object) {
    if (object instanceof CLong) {
      CLong other = (CLong)object;
      return other.value == value;
    }
    return false;
  }
  
  public int compareTo(CLong other) {
    return (value < other.value ? -1 : (value == other.value ? 0 : 1));
  }
}
